import {post,ajax} from '@/utils/ajax'

// 获取待办流程列表
export function listWfTodo(query){
    return post('/wf/task/todo/search',query);
}

// 获取待办流程审批记录
export function getApproveHistory(processInstanceId){
    return post('/wf/task/done/getApproveHistoryPage',{processInstanceId});
}

// 获取待办流程过程流程图
export function showFlowRunImgByInstantId(processInstanceId){
    const config = {
        url: '/wf/manager/deployment/showFlowRunImgByInstantId',
        method: 'post',
        data: {processInstanceId},
        responseType: 'arraybuffer'
    }
    return ajax(config);
}

// 获取待办流程过程审批人员
export function getProcessRunTaskAndApprover(processInstanceId){
    return post('/wf/task/done/getProcessRunTaskAndApprover',{processInstanceId})
}

// 获取流程以及节点上定义审批按钮
export function getWfButton(taskId){
    return post('/wf/task/todo/getApproveButtons',{taskId:taskId})
}

// 获取代理待办流程列表
export function listWfProxyTodo(query){
    return post('/wf/task/todo/searchProxy',query);
}
